import gi
import emj_builder as eb
gi.require_version('Gtk','3.0')
from gi.repository import Gtk

class Application(Gtk.Window):
    def __init__(self):
        Gtk.Window.__init__(self,title="emojiii")
        self.set_default_size(300, 300)
        self.set_border_width(10)

        scrolled = Gtk.ScrolledWindow()
        scrolled.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)


        self.box_outer = Gtk.Box(orientation=Gtk.Orientation.VERTICAL,spacing=5)
        scrolled.add(self.box_outer)

        buildr = eb.emj_builder()

        last_label = Gtk.Label("最近使用")
        last_flow_box = buildr.get_last_use_10()
        self.box_outer.add(last_label)
        self.box_outer.add(last_flow_box)

        all_label = Gtk.Label("所有Emoji")
        all_flow_box = buildr.build()

        self.box_outer.add(all_label)
        self.box_outer.add(all_flow_box)



        self.add(scrolled)




app = Application()
app.connect("delete-event", Gtk.main_quit)
app.show_all()
Gtk.main()
